namespace HybridCLR.Extension.Editor
{
    public partial class Commond 
    {
        [UnityEditor.MenuItem("HybridCLR/Extension/DllBuildAndMove")]
        public static void BuildDllBuildMove()
        {
            BuildParam buildParam = new BuildParam();
            CopyAotDllToPath(buildParam);
            CopyHotDllToPath(buildParam);
        }
        
        public static void BuildDllBuildMove(BuildParam buildParam)
        {
            if (buildParam.CatalogUpdateType == ECatalogUpdateType.Local)
            {
                HybridCLR.Editor.Commands.PrebuildCommand.GenerateAll();
            }
            else
            {
                HybridCLR.Editor.Commands.CompileDllCommand.CompileDllActiveBuildTargetRelease();
            }
            if (!CheckAccessMissingMetadata())
            {
                CopyAotDllToPath(buildParam);
                CopyHotDllToPath(buildParam);
            }
            else
            {
                UnityEditor.EditorUtility.DisplayDialog("构建Dll失败", "热更新代码中引用了被裁剪的类型或函数", "确定");
            }
        }
    }
}